#include "draw.h"

void drawBanner()
{
    // char banner[6][65];
    // // char *color[3] = {
    // //     "\033[31m",
    // //     "\033[32m",
    // //     "\033[34m"};
    // char *end = "\033[0m";
    // // 1. 初始化
    // for (int i = 0; i < 6; ++i)
    // {
    //     for (int j = 0; j < 65; ++j)
    //     {
    //         if (j == 64)
    //         {
    //             banner[i][j] = '\n';
    //         }
    //         else
    //         {
    //             banner[i][j] = ' ';
    //         }
    //     }
    // }
    // // 1 line
    // banner[0][2] = banner[0][3] = banner[0][4] = banner[0][5] = '_';
    // banner[0][32] = banner[0][33] = banner[0][34] = banner[0][35] = '_';
    // banner[0][40] = '_';
    // // 2 line
    // banner[1][1] = '|';
    // banner[1][4] = '_';
    // banner[1][6] = '\\';
    // banner[1][11] = banner[1][12] = banner[1][13] = '_';
    // banner[1][18] = banner[1][19] = banner[1][20] = '_';
    // banner[1][24] = banner[1][26] = banner[1][27] = '_';
    // banner[1][31] = '/';
    // banner[1][33] = banner[1][34] = banner[1][35] = '_';
    // banner[1][36] = banner[1][39] = banner[1][41] = '|';
    // banner[1][45] = banner[1][46] = banner[1][47] = '_';
    // banner[1][52] = banner[1][53] = banner[1][54] = '_';
    // banner[1][58] = banner[1][60] = banner[1][61] = '_';
    // // 3 line
    // banner[2][1] = banner[2][3] = banner[2][5] = banner[2][7] = '|';
    // banner[2][10] = banner[2][17] = '/';
    // banner[2][12] = banner[2][19] = '_';
    // banner[2][14] = banner[2][21] = '\\';
    // banner[2][23] = '|';
    // banner[2][25] = '\'';
    // banner[2][26] = '_';
    // banner[2][28] = banner[2][31] = '\\';
    // banner[2][32] = banner[2][33] = banner[2][34] = '_';
    // banner[2][36] = '\\';
    // banner[2][39] = banner[2][41] = '|';
    // banner[2][44] = banner[2][51] = '/';
    // banner[2][46] = banner[2][53] = '_';
    // banner[2][48] = banner[2][55] = '\\';
    // banner[2][57] = '|';
    // banner[2][59] = '\'';
    // banner[2][60] = '_';
    // banner[2][62] = '\\';
    // // 4 line
    // banner[3][1] = banner[3][3] = banner[3][5] = banner[3][7] = '|';
    // banner[3][4] = '_';
    // banner[3][9] = banner[3][16] = '|';
    // banner[3][12] = banner[3][13] = banner[3][19] = banner[3][20] = '_';
    // banner[3][14] = banner[3][21] = '/';
    // banner[3][23] = banner[3][25] = banner[3][29] = '|';
    // banner[3][26] = '_';
    // banner[3][27] = ')';
    // banner[3][32] = banner[3][33] = banner[3][34] = '_';
    // banner[3][35] = ')';
    // banner[3][37] = banner[3][39] = banner[3][41] = '|';
    // banner[3][43] = banner[3][50] = '|';
    // banner[3][46] = banner[3][47] = banner[3][53] = banner[3][54] = '_';
    // banner[3][48] = banner[3][55] = '/';
    // banner[3][57] = banner[3][59] = '|';
    // banner[3][60] = '_';
    // banner[3][61] = ')';
    // banner[3][63] = '|';
    // // 5 line
    // banner[4][1] = '|';
    // banner[4][2] = banner[4][3] = banner[4][4] = banner[4][5] = '_';
    // banner[4][6] = '/';
    // banner[4][10] = banner[4][17] = '\\';
    // banner[4][11] = banner[4][12] = banner[4][13] = banner[4][18] = banner[4][19] = banner[4][20] = '_';
    // banner[4][14] = banner[4][21] = '|';
    // banner[4][23] = '|';
    // banner[4][25] = '.';
    // banner[4][26] = banner[4][27] = '_';
    // banner[4][28] = '/';
    // banner[4][31] = '|';
    // banner[4][32] = banner[4][33] = banner[4][34] = banner[4][35] = '_';
    // banner[4][36] = '/';
    // banner[4][39] = banner[4][41] = '|';
    // banner[4][40] = '_';
    // banner[4][44] = banner[4][51] = '\\';
    // banner[4][45] = banner[4][46] = banner[4][47] =
    //     banner[4][53] = banner[4][54] = banner[4][55] = '_';
    // banner[4][48] = banner[4][55] = '|';
    // banner[4][57] = '|';
    // banner[4][59] = '.';
    // banner[4][60] = banner[4][61] = '_';
    // banner[4][62] = '/';
    // // 6 line
    // banner[5][23] = banner[5][25] =
    //     banner[5][57] = banner[5][59] = '|';
    // banner[5][24] = banner[5][58] = '_';
    // for (int i = 0; i < 6; ++i)
    // {
    //     for (int j = 0; j < 65; ++j)
    //     {
    //         if (banner[i][j] != ' ' && banner[i][j] != '\n')
    //         {
    //             printf("\033[33m%c%s", banner[i][j], end);
    //         }
    //         else
    //         {
    //             printf("%c", banner[i][j]);
    //         }
    //     }
    // }
    printf("\n");
    printf("\n");
    printf("\n");


    printf("%s\n","██████╗ ███████╗███████╗██████╗     ███████╗██╗     ███████╗███████╗██████╗ ");
    printf("%s\n","██╔══██╗██╔════╝██╔════╝██╔══██╗    ██╔════╝██║     ██╔════╝██╔════╝██╔══██╗");
    printf("%s\n","██║  ██║█████╗  █████╗  ██████╔╝    ███████╗██║     █████╗  █████╗  ██████╔╝");
    printf("%s\n","██║  ██║██╔══╝  ██╔══╝  ██╔═══╝     ╚════██║██║     ██╔══╝  ██╔══╝  ██╔═══╝ ");
    printf("%s\n","██████╔╝███████╗███████╗██║         ███████║███████╗███████╗███████╗██║     ");
    printf("%s\n","╚═════╝ ╚══════╝╚══════╝╚═╝         ╚══════╝╚══════╝╚══════╝╚══════╝╚═╝     ");
    printf("%s\n","                                                                            ");


    printf("\n");
    printf(BLUE "========================================\n");
    printf("|" CYAN "        欢迎使用用户管理系统         " BLUE "|\n");
    printf("========================================\n" RESET);
}

void drawLoginBanner()
{
    printf("%s\n","                                                       ");
    printf("%s\n","                                                       ");
    printf("%s\n","                                                       ");
    printf("%s\n","██╗          ██████╗      ██████╗     ██╗    ███╗   ██╗");
    printf("%s\n","██║         ██╔═══██╗    ██╔════╝     ██║    ████╗  ██║");
    printf("%s\n","██║         ██║   ██║    ██║  ███╗    ██║    ██╔██╗ ██║");
    printf("%s\n","██║         ██║   ██║    ██║   ██║    ██║    ██║╚██╗██║");
    printf("%s\n","███████╗    ╚██████╔╝    ╚██████╔╝    ██║    ██║ ╚████║");
    printf("%s\n","╚══════╝     ╚═════╝      ╚═════╝     ╚═╝    ╚═╝  ╚═══╝");
    printf("%s\n","                                                       ");
    printf("%s\n","                                                       ");
    printf("%s\n","                                                       ");

}

void drawRegisterBanner()
{

    printf("%s\n","                                                                                         ");
    printf("%s\n","                                                                                         ");
    printf("%s\n","                                                                                         ");
    printf("%s\n","██████╗     ███████╗     ██████╗     ██╗    ███████╗    ████████╗    ███████╗    ██████╗ ");
    printf("%s\n","██╔══██╗    ██╔════╝    ██╔════╝     ██║    ██╔════╝    ╚══██╔══╝    ██╔════╝    ██╔══██╗");
    printf("%s\n","██████╔╝    █████╗      ██║  ███╗    ██║    ███████╗       ██║       █████╗      ██████╔╝");
    printf("%s\n","██╔══██╗    ██╔══╝      ██║   ██║    ██║    ╚════██║       ██║       ██╔══╝      ██╔══██╗");
    printf("%s\n","██║  ██║    ███████╗    ╚██████╔╝    ██║    ███████║       ██║       ███████╗    ██║  ██║");
    printf("%s\n","╚═╝  ╚═╝    ╚══════╝     ╚═════╝     ╚═╝    ╚══════╝       ╚═╝       ╚══════╝    ╚═╝  ╚═╝");
    printf("%s\n","                                                                                         ");


}

void drawMenuBorder()
{
    printf(BLUE "+--------------------------------------+\n" RESET);
}

void drawMenuItem(const char *item)
{
    printf(BLUE "| " RESET "%-38s" BLUE " |\n" RESET, item);
}

// 绘制输入框
void drawInputBox(const char *prompt)
{
    printf(BLUE "\n+--------------------------------------+\n");
    printf("| " RESET "%-36s" BLUE " |\n", prompt);
    printf("+--------------------------------------+\n" RESET);
    printf(CYAN "> " RESET);
}